<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <!-- 引入 ECharts 文件 -->
    <script src="/static/echart/echarts.min.js"></script>
    <link rel="stylesheet" type="text/css" href="/static/easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="/static/easyui/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="/static/css/dreamlu.css" />
	<link rel="stylesheet" type="text/css" href="/static/css/icommon.css" />
	<script type="text/javascript" src="/static/js/jquery-1.10.1.min.js"></script>
	<script type="text/javascript" src="/static/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="/static/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="/static/js/HhUtil.js?t=20170109"></script>

    <link id="easyuiTheme" rel="stylesheet" type="text/css" href="/static/easyui/themes/gray/easyui.css" />
    <script type="text/javascript" src="/static/jquery-easyui-1.5.1/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/static/jquery-easyui-1.5.1/locale/easyui-lang-zh_CN.js"></script>
    <!-- [扩展样式] -->
</head>

<body>
<div id="toolbar">
    <table>
        <tr>
            <td><input id="start" name="start" type="text" class="easyui-datetimebox" required="required"></td>
            <td><span>至</span></td>
            <td><input id="end" name="end" type="text" class="easyui-datetimebox" required="required"></td>
            <th>不大于(单位:秒)</th>
            <td><input id="ngte" name="ngte" class="easyui-numberspinner" value="60" data-options="increment:1" style="width:120px;"></input></td>
            <th>不小于(单位:秒)</th>
            <td><input id="nlte" name="nlte" class="easyui-numberspinner" value="30" data-options="increment:1" style="width:120px;"></input></td>
            <td>
                <a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="exportFun();">导出excel</a>
            </td>
        </tr>
    </table>
</div>

</body>
<script type="text/javascript">
        // 基于准备好的dom，初始化echarts实例

        var Ajax={
            get: function (url,fn){
                var obj=new XMLHttpRequest();  // XMLHttpRequest对象用于在后台与服务器交换数据
                obj.open('GET',url,true);
                obj.onreadystatechange=function(){
                    if (obj.readyState == 4 && obj.status == 200 || obj.status == 304) { // readyState==4说明请求已完成
                        fn.call(this, obj.responseText);  //从服务器获得数据
                    }
                };
                obj.send(null);
            }
        }

        function GetDateStr(AddDayCount) {
            var dd = new Date();
            dd.setDate(dd.getDate()+AddDayCount);//获取AddDayCount天后的日期
            var y = dd.getFullYear();
            var m = dd.getMonth()+1;//获取当前月份的日期
            var d = dd.getDate();
            return y+"-"+m+"-"+d;
        }

        function exportFun() {
            location.href='/timelist?start='+$('#start').datetimebox('getValues')+'&end='+$('#end').datetimebox('getValues')+
            '&nlte='+$('#nlte').val()+'&ngte='+$('#ngte').val();
        }

        $(function () {
            $('#start').datetimebox('setValue', GetDateStr(-0)+' 08:00:00');
            $('#end').datetimebox('setValue', GetDateStr(-0) + ' 17:00:00');
        });

    </script>
</html>